#include <stdio.h>
#include <stdlib.h>
#include "dd_mesh.h"
#include "dd_triangle.h"

/* Free mesh from allocated memory
 * the mesh is left in an undefined state.
 * It should either get a new state with a
 * load function or not used anymore.

 * this needs some more work. I haven't decided
 * if "attr" should be free or will be static,
 * so for now it creates a memory leak.
 */
void dd_mesh_free(struct dd_mesh *m) {

	/* just pretend this is not here, 
	 * I need it for some testing
	 */
	printf("mesh free (no gl)\n");

	/* Free arrays */
	int i = 0;
	while (m->attr[i] != 0) {
		free( ((void**)m->ar)[i]);
		i++;
	}

	/* free the array-holder itself */
	free(m->ar);
}

void dd_mesh_draw(struct dd_mesh *m) {

}

void dd_mesh2_draw(struct dd_mesh2 *m) {

}
